#include <iostream>
#include <unordered_map>
#define LL long long
using namespace std;

const int kMaxN = 2e5 + 10;
unordered_map<LL, int> ma;

LL sum[kMaxN];
int a[kMaxN];

int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n, x;
  LL ans = 0;
  cin >> n >> x;
  ma[0] = 1;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    sum[i] = sum[i - 1] + a[i];
    ans += ma[sum[i] - x];
    ma[sum[i]]++;
  }
  cout << ans << "\n";
  return 0;
}